package org.dromara.system.mapper;

import org.apache.ibatis.annotations.Param;
import org.dromara.system.domain.VariableAssociationParam;
import org.dromara.system.domain.vo.VariableAssociationParamVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;

import java.util.List;

/**
 * 变量参数关联Mapper接口
 *
 * @author Lion Li
 * @date 2024-10-21
 */
public interface VariableAssociationParamMapper extends BaseMapperPlus<VariableAssociationParam, VariableAssociationParamVo> {

    List<VariableAssociationParam> selectByVariableIdAndThresholdsNotEqual(@Param("variableId") Long variableId);

    /**
     * 查询最接近的阈值
     * @param variableId
     * @param value
     * @return
     */
    VariableAssociationParam findClosestThreshold(@Param("variableId") Long variableId, @Param("value") Double value);
}
